package inesv.dto;

import com.alibaba.fastjson.JSON;

import java.io.Serializable;
import java.util.Date;

public class User implements Serializable {
	private Long id;

	private String username;

	private String phone;

	private String fpassword;

	private String spassword;

	private Integer activityState;

	private Integer state;

	private Date date;

	private Date outDate;

	private String twoPassword;// 二级密码

	private String fTwoPassword;// 二级明文密码

	private static final long serialVersionUID = 1L;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username == null ? null : username.trim();
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone == null ? null : phone.trim();
	}

	public String getFpassword() {
		return fpassword;
	}

	public void setFpassword(String fpassword) {
		this.fpassword = fpassword == null ? null : fpassword.trim();
	}

	public String getSpassword() {
		return spassword;
	}

	public void setSpassword(String spassword) {
		this.spassword = spassword == null ? null : spassword.trim();
	}

	public Integer getActivityState() {
		return activityState;
	}

	public void setActivityState(Integer activityState) {
		this.activityState = activityState;
	}

	public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public Date getOutDate() {
		return outDate;
	}

	public void setOutDate(Date outDate) {
		this.outDate = outDate;
	}

	public String getTwoPassword() {
		return twoPassword;
	}

	public void setTwoPassword(String twoPassword) {
		this.twoPassword = twoPassword;
	}

	public String getfTwoPassword() {
		return fTwoPassword;
	}

	public void setfTwoPassword(String fTwoPassword) {
		this.fTwoPassword = fTwoPassword;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append(getClass().getSimpleName());
		sb.append(" [");
		sb.append("Hash = ").append(hashCode());
		sb.append(", id=").append(id);
		sb.append(", username=").append(username);
		sb.append(", phone=").append(phone);
		sb.append(", fpassword=").append(fpassword);
		sb.append(", spassword=").append(spassword);
		sb.append(", activityState=").append(activityState);
		sb.append(", state=").append(state);
		sb.append(", date=").append(date);
		sb.append(", serialVersionUID=").append(serialVersionUID);
		sb.append("]");
		return sb.toString();
	}

	@Override
	public boolean equals(Object that) {
		if (this == that) {
			return true;
		}
		if (that == null) {
			return false;
		}
		if (getClass() != that.getClass()) {
			return false;
		}
		User other = (User) that;
		return (this.getId() == null ? other.getId() == null : this.getId()
				.equals(other.getId()))
				&& (this.getUsername() == null ? other.getUsername() == null
						: this.getUsername().equals(other.getUsername()))
				&& (this.getPhone() == null ? other.getPhone() == null : this
						.getPhone().equals(other.getPhone()))
				&& (this.getFpassword() == null ? other.getFpassword() == null
						: this.getFpassword().equals(other.getFpassword()))
				&& (this.getSpassword() == null ? other.getSpassword() == null
						: this.getSpassword().equals(other.getSpassword()))
				&& (this.getActivityState() == null ? other.getActivityState() == null
						: this.getActivityState().equals(
								other.getActivityState()))
				&& (this.getState() == null ? other.getState() == null : this
						.getState().equals(other.getState()))
				&& (this.getDate() == null ? other.getDate() == null : this
						.getDate().equals(other.getDate()));
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
		result = prime * result
				+ ((getUsername() == null) ? 0 : getUsername().hashCode());
		result = prime * result
				+ ((getPhone() == null) ? 0 : getPhone().hashCode());
		result = prime * result
				+ ((getFpassword() == null) ? 0 : getFpassword().hashCode());
		result = prime * result
				+ ((getSpassword() == null) ? 0 : getSpassword().hashCode());
		result = prime
				* result
				+ ((getActivityState() == null) ? 0 : getActivityState()
						.hashCode());
		result = prime * result
				+ ((getState() == null) ? 0 : getState().hashCode());
		result = prime * result
				+ ((getDate() == null) ? 0 : getDate().hashCode());
		return result;
	}

	public static void main(String[] args) {
		User user = new User();
		user.setId(1L);
		user.setUsername("test");
		user.setPhone("15218612811");
		System.out.println(JSON.toJSONString(user) );
	}
}